package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.blockhandler.MoitorBlockHandler;
import com.xxxy.fallback.TestFallback;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Stack;


@RestController
@RequestMapping("/dsg")
public class Testcontroller {
    @SentinelResource(value = "helloResource",fallback = "ltfrt",
           fallbackClass = TestFallback.class)
    @GetMapping("ltf")
    public String ltfrt(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    return "我学不会Java";
    }

}
